package factorydemo.simplefactory;

import factorydemo.BMW;
import factorydemo.BMW320;
import factorydemo.BMW520;

public class BMWFactory {
	
	
	public static BMW createBMW(String type) {
		switch(type) {
		case "320":
			return new BMW320();
		case "520":
			return new BMW520();
		default:
			throw new RuntimeException("没有这个类型");
		}
	}

}
